/**
 * 
 */
package com.school.homeServlet.cmd;

import java.io.IOException;
import java.util.logging.Logger;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.school.dao.AdmissionDao;
import com.school.dao.AdmissionDaoImpl;
import com.school.entity.StudentAdmission;

/**
 * @author KK
 *
 */
public class StudentAdmissionFormCommand implements HomeCommand {

	/* (non-Javadoc)
	 * @see com.school.homeServlet.cmd.HomeCommand#processRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.ServletConfig)
	 */
	public static Logger log = Logger.getLogger(StudentAdmissionFormCommand.class.getSimpleName());
	@Override
	public void processRequest(HttpServletRequest req,
			HttpServletResponse resp, ServletConfig config)
			throws ServletException, IOException {
		// TODO Auto-generated method stub
		AdmissionDao ad = new AdmissionDaoImpl();
		StudentAdmission st = new StudentAdmission();
		
		st.setAdd1(req.getParameter("address1"));
		st.setAdd2(req.getParameter("address2"));
		st.setBg(req.getParameter("bg"));
		st.setCategory(req.getParameter("category"));
		st.setCity(req.getParameter("city"));
		st.setContact(req.getParameter(""));
		st.setDob(req.getParameter(""));
		st.setEmail(req.getParameter(""));
		st.setFname(req.getParameter(""));
		st.setFoccupation(req.getParameter(""));
		st.setGender(req.getParameter(""));
		st.setMname(req.getParameter(""));
		st.setMoccupation(req.getParameter(""));
		st.setName1(req.getParameter(""));
		st.setName2(req.getParameter(""));
		st.setPin(req.getParameter(""));
		st.setRef_no(req.getParameter(""));
		st.setReligion(req.getParameter(""));
		st.setState(req.getParameter(""));
		
		
		req.setAttribute("admissionRegSuccess", true);
		req.setAttribute("getAdmissionForm", false);
		req.setAttribute("aboutUs", false);
		req.setAttribute("newRegistrationForm", false);
		req.setAttribute("contactUs", false);
		req.setAttribute("applicantStatus", false);
	
			
		RequestDispatcher dispatcher = req.getRequestDispatcher("/school_home.jsp");
		dispatcher.forward(req, resp);

	}

}
